package com.sw.bbs.user.dao;

import com.sw.bbs.user.pojo.User;
import com.sw.bbs.user.vo.LoginRequest;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface UserMapper {
    int deleteByPrimaryKey(Integer userId);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer userId);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);


    /**
     * 验证登陆
     * @param loginRequest
     * @return
     */
    User selectByLoginRequest(LoginRequest loginRequest);


    /**
     * 用户名
     * @param username
     * @return
     */
    User selectByUsername(@Param("username") String username);

    /**
     * 手机
     * @param phone
     * @return
     */
    User selectByPhone(@Param("phone") String phone);




}